package pack2;

import java.util.Scanner;
public class java17 {
    public static void main(String[] arge){
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int Arry[]=new int[a];
        int Brry[]=new int[a];
        int sum=0;
        for (int i = 0; i < a; i++) {
            Arry[i]=sc.nextInt();
            Brry[i]=sc.nextInt();
            sum+=Arry[i]*Brry[i];
        }
        sum=Math.max(0,sum);
        System.out.println(sum);
    }

}
